<?php
/**
 * Core Error Controller
 *
 * @category   Kysat
 * @package    Kysat_Core
 * @subpackage Error
 * @copyright  Copyright (c) 2008 Joseph Bratton
 */

/**
 * @category   Kysat
 * @package    Kysat_Core
 * @subpackage Error
 * @copyright  Copyright (c) 2008 Joseph Bratton
 */
class ErrorController extends Zend_Controller_Action
{
    /**
     * Handle 404 errors
     *
     * @access public
     */
    public function errorAction()
    {
        $errors = $this->_getParam('error_handler');

        switch ($errors->type) {
            case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
            case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
                // 404 error -- controller or action not found
                $this->getResponse()->setRawHeader('HTTP/1.1 404 Not Found');

                // ... get some output to display...
                break;
            default:
                // application error; display error page, but don't change
                // status code
                break;
        }
    }
}
